/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.clientapi.provider;

import com.jili.ubert.clientapi.until.AnswerHandler;
import com.jili.ubert.clientapi.listener.LastPriceListener;
import com.jili.ubert.clientapi.listener.PriceListener;
import com.jili.ubert.code.server2client.MsgResult;
import com.panemu.tiwulfx.common.TableData;
import com.jili.ubert.code.server2client.Price;
import com.jili.ubert.dao.db.FundTransfer;
import com.jili.ubert.dao.db.ObjInfo;
import com.jili.ubert.dao.db.ObjNewStock;
import com.jili.ubert.dao.db.ObjPriceTick;
import java.io.IOException;
import java.util.List;

/**
 *
 * @author ChengJili
 */
public interface MarketDataProvider {

//    public MsgResult Connect(String host, int port, boolean isSSL, boolean isZlib);
//    public MsgResult Login(Login login);
//    public MsgResult UserLogin(Login login);

    /*
     业务实现
     */
    //1.获取最新价
    public int getLNCPrice(String objID, AnswerHandler<Double> handler) throws IOException;

    public int getLastPrice(String objID, AnswerHandler<Double> handler) throws IOException;

    public int getLastPriceQueue1(String objID, AnswerHandler<Price> handler) throws IOException;

    public int getLastPriceQueue5(String objID, AnswerHandler<Price> handler) throws IOException;

    public int getLastPriceQueue10(String objID, AnswerHandler<Price> handler) throws IOException;

    //2.注册行情
//    public int RegistLastPrice(List<String> objList, AnswerHandler<Double> handler) throws IOException;

    public int RegistPrice(List<String> objList, int type, AnswerHandler<Price> handler) throws IOException;
    public int RegistPrice(String mk,String obj,int type, AnswerHandler<Price> handler) throws IOException;

    public int RegistPrice(List<String> objList, AnswerHandler<Price> handler) throws IOException;
    public int RegistPrice(String mk,String obj, AnswerHandler<Price> handler) throws IOException;

    public int RemoveRegistPrice(List<String> objList, AnswerHandler<MsgResult> handler) throws IOException;
    public int RemoveRegistPrice(String mk,String obj, AnswerHandler<MsgResult> handler) throws IOException;
    public void RemoveRegistPrice(String objid, AnswerHandler<Price> handler) throws IOException;

    //3.基本数据
    //股票列表
    public int QueryObjList(AnswerHandler<TableData<ObjInfo>> handler) throws IOException;

    public int QueryObjList(String obj, AnswerHandler<TableData<ObjInfo>> handler) throws IOException;

    public int QueryObjList(String mk, String obj, AnswerHandler<ObjInfo> handler) throws IOException;

    public int QueryNewObjList(AnswerHandler<TableData<ObjNewStock>> handler) throws IOException;

    //最小变动加

    public int QueryPriceTickList(AnswerHandler<TableData<ObjPriceTick>> handler) throws IOException;

    public int QueryPriceTick(String obj, AnswerHandler<TableData<ObjPriceTick>> handler) throws IOException;

    public int QueryPriceTick(String mk, String obj, AnswerHandler<ObjPriceTick> handler) throws IOException;
    //4.通用接口

}
